using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using QuanLyKho.DAL;
using QuanLyKho.Entity;
namespace QuanLyKho.BL
{
    class bXuatKhoDetail
    {
        DAO dao = new DAO();
        public int insertXuatKhoDetail(eXuatKhoDetail nkd)
        {
            IList<SqlParameter> paramList = new List<SqlParameter>();
            SqlParameter pr = new SqlParameter("@maHang", SqlDbType.VarChar);
            pr.Value = nkd.maHang;
            paramList.Add(pr);

            pr = new SqlParameter("@nkId", SqlDbType.Int);
            pr.Value = nkd.nkId;
            paramList.Add(pr);

            pr = new SqlParameter("@soLuong", SqlDbType.Int);
            pr.Value = nkd.soLuong;
            paramList.Add(pr);

            pr = new SqlParameter("@donGia", SqlDbType.Float);
            pr.Value = nkd.donGia;
            paramList.Add(pr);

            int r = dao.ExecuteNonQuery("insertXuatKhoDetail", CommandType.StoredProcedure, paramList);
            dao.CloseConnection();
            return r;

        }
    }
}
